package com.luo.chengrui.license.generate;

import com.luo.chengrui.license.validate.LicenseUtil;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * @author
 * @version 1.0.0
 * @description
 * @createTime 2023/12/06
 */
@RunWith(SpringRunner.class)
@SpringBootTest
@ActiveProfiles("jrc")
public class GenerateTest_JRC {

    @Autowired
    LicenseGenerater licenseGenerater;
    //四川嘉润辰医药有限公司
    @Test
    public void genYTWMS_TYJ_Lisence() {
        License license = new License();
        license.setLicenceId("JRC_20241031");
        license.setExpiration("2099-12-31");
//        license.setMacAddress("00-16-3E-16-EE-21");//云服务器
        license.setMacAddress("d8-f8-83-0c-0d-23,4C-10-D5-92-E9-97");// 客户是双网卡
        license.setVendor("四川嘉润辰-民生仓库管理系统");
        licenseGenerater.generateLicence(license);
        LicenseUtil.INSTANCE.validate();
        System.out.println("授权有效," + LicenseUtil.INSTANCE.getExpiredDate());
    }
}
